/*
 * KeyMessage.java
 *
 * Created on June 18, 2007, 12:17 AM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package jhub.text;

import java.text.MessageFormat;
import java.text.ParseException;
import jhub.DCProtocol;

/**
 *
 * @author dbotelho
 */
public class KeyMessage extends DCRawCommand{
    private String key;
    
    /** Creates a new instance of KeyMessage */
    public KeyMessage(String command) throws ParseException{
        super(command);
        parse();
    }
    
    private void parse() throws ParseException{
        Object[] o = new MessageFormat(DCProtocol.KEY_FORMAT).parse(command.toString());
        this.key = o[0].toString();
    }

    public String getKey() {
        return key;
    }
    
}
